﻿<UserControl x:Class="ETRobocon.RaceTraking.GameManagement.TurnMgmtUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:src="clr-namespace:ETRobocon.RaceTraking.GameManagement"
    Height="608" Width="808">
    <UserControl.Resources>
        <src:WSRound x:Key="targetRound"/>
        <src:WSTurn x:Key="currentTurn"/>
        <src:WSTeamEntry x:Key="inCourseTeam"/>
        <src:WSTeamEntry x:Key="outCourseTeam"/>
        <Style TargetType="Label">
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>
        <Style TargetType="Button">
            <Setter Property="MinWidth" Value="75"/>
            <Setter Property="Margin" Value="5,5,5,5"/>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="304"/>
            <ColumnDefinition Width="504"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="254"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid Grid.Column="0" Grid.Row="0">
            <Grid.DataContext>
                <Binding Source="{StaticResource targetRound}"/>
            </Grid.DataContext>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="90*" />
                <ColumnDefinition Width="114*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="32"/>
                <RowDefinition Height="32"/>
                <RowDefinition Height="32"/>
                <RowDefinition Height="80"/>
            </Grid.RowDefinitions>
            <Label Grid.ColumnSpan="3" Content="Target Round:" FontSize="20"/>
            <Label Grid.Column="0" Grid.Row="1" Content="Game Name:"></Label>
            <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Path=Parent.Name}" Grid.ColumnSpan="2"></TextBlock>
            <Label Grid.Column="0" Grid.Row="2" Content="Round ID:"></Label>
            <TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding Path=ID}" Grid.ColumnSpan="2"></TextBlock>
            <Label Grid.Column="0" Grid.Row="3" Content="Round No:"></Label>
            <TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding Path=No}" Grid.ColumnSpan="2"></TextBlock>
            <Grid Grid.Row="4" Grid.ColumnSpan="3" Margin="0,0,0,-37">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left">
                        <Button Name="buttonNext" Click="buttonNext_Click" ToolTip="次のレースを表示">Next</Button>
                    </StackPanel>
                    <StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button Name="buttonStart" Click="buttonStart_Click" HorizontalAlignment="Right" Visibility="Hidden" IsEnabled="False">Start</Button>
                    </StackPanel>
                    <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button Name="buttonEnd" Click="buttonEnd_Click" HorizontalAlignment="Right" IsEnabled="False" ToolTip="Roundの終了">End</Button>
                    </StackPanel>
                    <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button Name="buttonCancel" HorizontalAlignment="Center" IsEnabled="False" Click="buttonCancel_Click" ToolTip="主審がキャンセル押してくれない場合、業を煮やしてこちらでリセット">Cancel</Button>
                    </StackPanel>
                    <StackPanel Grid.Column="2" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button Name="buttonBack" HorizontalAlignment="Right" IsEnabled="False" Click="buttonBack_Click" ToolTip="直前のターンをやり直し">Back</Button>
                    </StackPanel>
                    <StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left">
                        <Button Name="ButtonVoice" Click="ButtonVoice_Click" ToolTip="声を出力。さぁいってみようっ">Go Voice</Button>
                        <!-- 下のSourceのMedia/3-2-1-GO.wavの値を絶対パスに変更してください。 -->
                        <MediaElement x:Name="Sound321Go" Source="C:\GoVA\ETRoboConTrakingSystem\GameManagement\Media\3-2-1-GO.wav" LoadedBehavior="Manual"/>
                    </StackPanel>
                    <StackPanel Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3" Orientation="Horizontal">
                        <CheckBox Name="CheckBoxMoveTurnIsLast" VerticalAlignment="Center" IsChecked="True" IsEnabled="False">To Last</CheckBox>
                        <Button Name="ButtonMoveTurn" Click="ButtonMoveTurn_Click" ToolTip="ターンを1つ後ろ、もしくは最後に移動" IsEnabled="False">Move Current Turn</Button>
                        <CheckBox Name="CheckBoxSpecialNotify" VerticalAlignment="Center" IsChecked="True" IsEnabled="True">ドリフト指示</CheckBox>
                    </StackPanel>
                </Grid>
            </Grid>
        </Grid>
        <Grid Grid.Column="1" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="250"/>
                <ColumnDefinition Width="250"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="164"/>
                <RowDefinition Height="40"/>
            </Grid.RowDefinitions>
            <Label Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Content="Current Turn:" FontSize="20"/>
            <src:TurnTeamEntryUserControl  Grid.Column="0" Grid.Row="1" x:Name="tteUCIC" CourseName="IN"/>
            <src:TurnTeamEntryUserControl  Grid.Column="1" Grid.Row="1" x:Name="tteUCOC" CourseName="OUT"/>
            <Grid Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left">
                    <Button Name="buttonTurnDone" Click="buttonTurnDone_Click" IsEnabled="False" ToolTip="レース結果を登録">Done</Button>
                </StackPanel>
                <CheckBox Grid.Column="1" Name="cbObstructedOperation" Content="Obstruction" HorizontalAlignment="Right" VerticalAlignment="Center" IsEnabled="False" Checked="cbObstructedOperation_Checked" />
                <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button Name="buttonTurnAgain" Click="buttonTurnAgain_Click" IsEnabled="False" ToolTip="直後に再走">Again</Button>
                </StackPanel>
                <StackPanel Grid.Column="3" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Name="buttonTurnLast" Click="buttonTurnLast_Click" IsEnabled="False" ToolTip="一番最後に後回し">Last</Button>
                </StackPanel>
            </Grid>
        </Grid>
        <Grid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Column="0" Grid.Row="0">
<!--                <src:RunnerMgmtUserControl x:Name="icRunnerConsole" CourseImageUri="InCourse09.JPG"/> -->
                <src:RunnerMgmtUserControl x:Name="icRunnerConsole" />
            </StackPanel>
            <StackPanel Grid.Column="1" Grid.Row="0">
<!--                <src:RunnerMgmtUserControl x:Name="ocRunnerConsole" CourseImageUri="OutCourse09.JPG"/> -->
                <src:RunnerMgmtUserControl x:Name="ocRunnerConsole" />
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
